
<%@ page import="Biblioteca.Exemplar" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <g:if test="${tipo == 'Admin'}">
       <meta name="layout" content="adminBiblioteca" />
        </g:if>
        <g:else>
        	<meta name="layout" content="usuarioBiblioteca" />
        </g:else>
        <g:set var="entityName" value="${message(code: 'exemplar.label', default: 'Exemplar')}" />
        <title><g:message code="SPL - Exemplares" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <h1><g:message code="Exemplares" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="fornecedor" title="${message(code: 'exemplar.fornecedor.label', default: 'Fornecedor')}" />
                        
                            <g:sortableColumn property="livro" title="${message(code: 'exemplar.livro.label', default: 'Livro')}" />
                        
                            <g:sortableColumn property="dataDeAquisicao" title="${message(code: 'exemplar.dataDeAquisicao.label', default: 'Data De Aquisicao')}" />
                            
                            <g:sortableColumn property="id" title="${message(code: 'Detalhes', default: 'Detalhes')}" />
                        
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${exemplarInstanceList}" status="i" var="exemplarInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td>${fieldValue(bean: exemplarInstance, field: "fornecedor")}</td>
                        
                            <td>${fieldValue(bean: exemplarInstance, field: "livro")}</td>
                        
                            <td><g:formatDate date="${exemplarInstance.dataDeAquisicao}" /></td>
                            
                            <td><g:link action="show" id="${exemplarInstance.id}">Ver mais</g:link></td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${exemplarInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
